//
//  GWWaterFllowView.h
//  瀑布流
//
//  Created by qianfeng on 16/2/29.
//  Copyright (c) 2016年 高炜. All rights reserved.
//

#import <UIKit/UIKit.h>
typedef enum {
GWWaterFllowViewMarginTypeLeft,
  GWWaterFllowViewMarginTypeRight,
    GWWaterFllowViewMarginTypeTop,
    GWWaterFllowViewMarginTypeBottom,
    GWWaterFllowViewMarginTypeClumns,
    GWWaterFllowViewMarginTypeRow,
}GWWaterFllowViewMarginType;

@class GWWaterFllowView,GWWaterFllowViewCell;
/** DataSource*/
@protocol GWWaterFllowViewDataSource <NSObject>
//WaterFllowView中有多少条数据
- (NSInteger)numberOfCellsInWaterFllowView:(GWWaterFllowView *)waterFllowView;
//返回每一条GWWaterFllowViewCell
- (GWWaterFllowViewCell *)waterFllowView:(GWWaterFllowView *)waterFllowView cellForRowAtIndex:(NSInteger)Index;

@optional
//WaterFllowView中数据分几列显示
- (NSInteger)numberOfclumnsInWaterFllowView:(GWWaterFllowView *)waterFllowView;
@end
/** Delegate*/
@protocol GWWaterFllowViewDelegate <UIScrollViewDelegate>


- (void)waterFllowView:(GWWaterFllowView *)waterFllowView didSelectCellAtIndex:(NSInteger)index;

@optional
- (CGFloat)waterFllowView:(GWWaterFllowView *)waterFllowView heightForCellAtIndex:(NSInteger )index;
- (CGFloat)waterFllowView:(GWWaterFllowView *)waterFllowView marginWithType:(GWWaterFllowViewMarginType)marginType;

@end
@interface GWWaterFllowView : UIScrollView
@property (nonatomic,weak)id<GWWaterFllowViewDataSource>dataSource;
@property (nonatomic,weak)id<GWWaterFllowViewDelegate>delegate;

-(void)reloadData;

- (id)dequeueReusableCellWithIdentifier:(NSString *)identifier;

-(CGFloat)cellWidth;
@end
